package com.css.fxfzfxqh.modules.singleIndexRiskZoning.service;

import com.alibaba.druid.util.StringUtils;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.css.fxfzfxqh.base.response.RestResponse;
import com.css.fxfzfxqh.common.rest.model.bo.ChinaGridBo;
import com.css.fxfzfxqh.common.rest.model.vo.ChinaGridVo;
import com.css.fxfzfxqh.modules.buildingKilometerGrid.threadpool.BizThreadPoolManage;
import com.css.fxfzfxqh.modules.buildings.calculationTasks.entity.CalculationTasks;
import com.css.fxfzfxqh.modules.buildings.calculationTasks.repository.CalculationTasksRepository;
import com.css.fxfzfxqh.modules.buildings.calculationTasks.service.CalculationTasksService;
import com.css.fxfzfxqh.modules.buildings.definitiveEvaluation.casualtiesDE.service.CasualtiesDEService1;
import com.css.fxfzfxqh.modules.buildings.definitiveEvaluation.economicLossDE.service.EconomicLossEDService;
import com.css.fxfzfxqh.modules.buildings.definitiveEvaluation.resistEarthquakesDE.service.ResistEarthquakesDEService;
import com.css.fxfzfxqh.modules.buildings.definitiveEvaluation.resistEarthquakesDE.vo.ResistEarthquakesPCCVO;
import com.css.fxfzfxqh.modules.buildings.probabilityEvaluation.resistEarthquakesPE.entity.ResistEarthquakesPECalculation;
import com.css.fxfzfxqh.modules.seismicHazardData.entity.PsHazardDataEntity;
import com.css.fxfzfxqh.modules.seismicHazardData.param.psHazard.ListByRangeParam;
import com.css.fxfzfxqh.modules.singleIndexRiskZoning.model.entity.*;
import com.css.fxfzfxqh.modules.singleIndexRiskZoning.model.vo.FxqhAssessEdQhResultVo;
import com.css.fxfzfxqh.modules.singleIndexRiskZoning.param.QhSingleExportParam;
import com.css.fxfzfxqh.modules.singleIndexRiskZoning.repository.EnterAssessQhRepository;
import com.css.fxfzfxqh.modules.singleIndexRiskZoning.vo.GdpVO;
import com.css.fxfzfxqh.modules.singleIndexRiskZoning.vo.QhSingleExportVO;
import com.css.fxfzfxqh.modules.singleIndicatorRiskZoneSet.service.SingleIndicatorRiskZoneSetService;
import com.css.fxfzfxqh.modules.util.ExcelUtil;
import com.css.fxfzfxqh.modules.util.hypergraph.service.HypergraphService;
import com.css.fxfzfxqh.util.*;
import com.css.fxfzfxqh.web.PlatformSessionContext;
import com.css.fxfzfxqh.zcpt.sys.entity.DeptEntity;
import com.css.fxfzfxqh.zcpt.sys.entity.SUser;
import com.css.fxfzfxqh.zcpt.sys.service.SUserService;
import com.css.fxfzfxqh.zcpt.sys.service.SysDeptService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.apache.poi.hssf.usermodel.HSSFDataFormatter;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.usermodel.WorkbookFactory;
import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.apache.tomcat.util.http.fileupload.IOUtils;
import org.geotools.data.FeatureWriter;
import org.geotools.data.shapefile.ShapefileDataStore;
import org.geotools.data.shapefile.ShapefileDataStoreFactory;
import org.geotools.feature.simple.SimpleFeatureTypeBuilder;
import org.geotools.referencing.CRS;
import org.locationtech.jts.geom.MultiPolygon;
import org.opengis.feature.simple.SimpleFeature;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.math.BigDecimal;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;

@Slf4j
@Service
public class EnterAssessQhService {
    @Resource
    private EnterAssessQhRepository enterAssessQhRepository;
    @Resource
    EconomicLossEDService economicLossEDService;
    @Resource
    CasualtiesDEService1 casualtiesDEService1;
    @Resource
    ResistEarthquakesDEService resistEarthquakesDEService;
    @Resource
    SUserService sUserService;
    @Resource
    SysDeptService sysDeptService;
    @Resource
    private HypergraphService hypergraphService;
    @Autowired
    private CalculationTasksRepository calculationTasksRepository;
    @Resource
    private RedisTemplate redisTemplate;
    public static final String SYS_USER_INFO_KEY = "sys:details:user";
    //    @Autowired
//    private CalculationTasksRepository calculationTasksRepository;
    @Autowired
    private CalculationTasksService calculationTasksService;
    @Autowired
    private SingleIndicatorRiskZoneSetService singleIndicatorRiskZoneSetService;
    @Value("${image.localDir}")
    private String localDir;

    /**
     * 获取区划记录列表分页
     *
     * @param param
     * @return
     */
    public Map<String, Object> getAssessPage(Map<String, Object> param, int curPage, int pageSize) {
        Map<String, Object> pageMap = enterAssessQhRepository.getAssessPage(param, curPage, pageSize);
        return pageMap;
    }

    public String getCode() {
        //抗震能力确定评估
        StringBuilder code = new StringBuilder("QH-");
        //查询最近一次code
        String oldCode = enterAssessQhRepository.queryLatest(code);
        if (StringUtils.isEmpty(oldCode)) {
            code.append("0001");
        } else {
            String[] split = oldCode.split("-");
            code.append(getNext(split[1]));
        }
        return code.toString();
    }

    /****
     * 从哪里开始计数 比如startValue=2，则会从003,004,005等
     * @param startValue
     * @return
     */
    public String getNext(String startValue) {
        Integer i = Integer.valueOf(startValue);
        String format = String.format("%04d", i + 1);
        return format;
    }

    /**
     * 根据当前登录人获取省id
     *
     * @return
     */
    public String getAreaByUserId() {
        String userId = PlatformSessionUtils.getUserId();
        if (PlatformObjectUtils.isEmpty(userId)) {
            return null;
        }
        String redisKey = SYS_USER_INFO_KEY;
        ValueOperations<String, SUser> valueOperations = redisTemplate.opsForValue();
        SUser sUser = valueOperations.get(redisKey + userId);
        if (sUser != null) {
            return sUser.getProvinceId();
        }
        String userJson = sUserService.getSUser(userId);
        if (PlatformObjectUtils.isEmpty(userJson)) {
            return null;
        }
        sUser = CreateGson.createGson().fromJson(userJson, SUser.class);
        valueOperations.set(redisKey + userId, sUser);
        redisTemplate.expire(redisKey + userId, 60, TimeUnit.MINUTES);
        return sUser.getProvinceId();
    }

    /**
     * 根据条件获取评估记录
     *
     * @param param
     * @return
     */
    public List<Assess> getAssessByParam(Map<String, Object> param) {
        List<Assess> assessList = enterAssessQhRepository.getAssessByParam(param);
        return assessList;
    }

    @Transactional
    public RestResponse saveFxqhAssessEd(FxqhAssessEdQh entity) {
        String userId = PlatformSessionUtils.getUserId();
        String userJson = sUserService.getUserById(userId);
        SUser sUser = CreateGson.createGson().fromJson(userJson, SUser.class);
        String deptJson = sysDeptService.getMainDeptByUserId(userId);
        DeptEntity deptEntity = CreateGson.createGson().fromJson(deptJson, DeptEntity.class);
        if (PlatformObjectUtils.isEmpty(entity.getFaeId())) {
            entity.setFaeId(UUIDGenerator.getUUID());
        }
        if (PlatformObjectUtils.isEmpty(entity.getZoningCode())) {
            entity.setZoningCode(getCode());
        }
        entity.setDelFlag("0");
        entity.setCreateUser(userId);
        entity.setCreateUserName(sUser.getUserName());
        entity.setDeptName(deptEntity.getDeptName());
        entity.setCreateTime(PlatformDateUtils.getCurrentTimestamp());
        enterAssessQhRepository.saveFxqhAssessEd(entity);
        return RestResponse.succeed("保存成功！");
    }

    @Transactional
    public RestResponse saveTask(CalculationTasks entity) throws Exception {
        String userId = PlatformSessionUtils.getUserId();
        String userJson = sUserService.getUserById(userId);
        SUser sUser = CreateGson.createGson().fromJson(userJson, SUser.class);
//        String deptJson = sysDeptService.getMainDeptByUserId(userId);
//        DeptEntity deptEntity = CreateGson.createGson().fromJson(deptJson, DeptEntity.class);
        if (PlatformObjectUtils.isEmpty(entity.getId())) {
            entity.setId(UUIDGenerator.getUUID());
        }
//        if (PlatformObjectUtils.isEmpty(entity.getZoningCode())) {
//            entity.setZoningCode(getCode());
//        }
        entity.setDelFlag("0");
        entity.setCreateUser(userId);
        entity.setCreateUserName(sUser.getUserName());
//        entity.setDeptName(deptEntity.getDeptName());
        entity.setCreateTime(PlatformDateUtils.getCurrentTimestamp());
//        calculationTasksRepository.addTask(entity);
        calculationTasksService.addTask(entity);
        return RestResponse.succeed("保存成功！");
    }

    public JSONObject getById(String id) {
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("entity", enterAssessQhRepository.getById(id));
        jsonObject.put("list", enterAssessQhRepository.getByFaeId(id));
        return jsonObject;
    }

    @Transactional
    public RestResponse updateFxqhAssessEd(FxqhAssessEdQh entity) {
        String userId = PlatformSessionUtils.getUserId();
        entity.setUpdateUser(userId);
        entity.setUpdateTime(PlatformDateUtils.getCurrentTimestamp());
        enterAssessQhRepository.updateFxqhAssessEd(entity);
        return RestResponse.succeed("修改成功！");
    }

    @Transactional
    public RestResponse updateTask(CalculationTasks entity) {
        String userId = PlatformSessionUtils.getUserId();
        entity.setUpdateUser(userId);
        entity.setUpdateTime(PlatformDateUtils.getCurrentTimestamp());
        calculationTasksService.updateById(entity);
        return RestResponse.succeed("修改成功！");
    }

    @Transactional
    public RestResponse doZoning(Map<String, Object> param) {
        RestResponse restResponse = null;
        try {
            List<FxqhAssessEdQhResult> resultList = new ArrayList<>();
            FxqhAssessEdQh entity = JSON.parseObject(JSON.toJSONString(param), FxqhAssessEdQh.class);
            //区划评估对象,1:抗震能力;2:人员伤亡;3:经济损失
            String estimateObj = entity.getEstimateObj();
            if ("1".equals(estimateObj)) {
                //抗震能力
                resultList = resistEarthquakesDEService.doZoning(entity);
            } else if ("2".equals(estimateObj)) {
                //人员伤亡
                resultList = casualtiesDEService1.doZoning(entity);
            } else if ("3".equals(estimateObj)) {
                //经济损失
                resultList = economicLossEDService.doZoning(entity);
            }
            // String faeId = UUIDGenerator.getUUID();
            // FxqhAssessEd fxqhAssessEd=new FxqhAssessEd();
            // UpdateUtil.copyNullProperties(param, fxqhAssessEd);
            String faeId = entity.getFaeId();
            if (PlatformObjectUtils.isEmpty(faeId)) {
                faeId = UUIDGenerator.getUUID();
                entity.setFaeId(faeId);
                saveFxqhAssessEd(entity);
            } else {
                updateFxqhAssessEd(entity);
            }

            enterAssessQhRepository.delFxqhAssessEdResultByFaeId(faeId);
            for (FxqhAssessEdQhResult result : resultList) {
                result.setId(UUIDGenerator.getUUID());
                result.setFaeId(faeId);
                result.setEstimateObj(entity.getEstimateObj());
                result.setHouseDataFlag(entity.getHouseDataFlag());
                result.setCondition(entity.getCondition());
                result.setSeismicInputMode(entity.getSeismicInputMode());
                int type = taskEstiConvertRiskZoneType(result);
                result.setQhLevel(singleIndicatorRiskZoneSetService.getLevel(result.getCalculatedValue(), type));
                enterAssessQhRepository.saveFxqhAssessEdResult(result);
            }
            //刷新指定超图工作空间数据源数据集
            boolean bool = hypergraphService.getWorkspaceReload("fxqh_assess_ed_qh_result");

            restResponse = RestResponse.succeed(resultList);
            restResponse.setMessage("计算成功！");
        } catch (Exception e) {
            e.printStackTrace();
            restResponse = RestResponse.fail(e.getLocalizedMessage());
        }
        return restResponse;
    }

    @Transactional
    public RestResponse doZoning(String taskId,String selectedVal) throws Exception{
        RestResponse restResponse = null;
        try {
            List<FxqhAssessEdQhResult> resultList = new ArrayList<>();
            CalculationTasks calculationTasks = calculationTasksService.findById(taskId);
            if (calculationTasks.getAssessType().equals("1")) {
                throw new RuntimeException("当前任务为概率评估，无法进行确定评估风险区划");
            }
            String[] split = selectedVal.split(",");
            enterAssessQhRepository.delByTaskId(taskId,Arrays.asList(split));

            //区划评估对象,1:抗震能力;2:人员伤亡;3:经济损失
            String assessObjArrStr = calculationTasks.getAssessObj();
//            for (String assessObj : assessObjArrStr.split(",")) {
            for (String assessObj : selectedVal.split(",")) {
                //抗震能力
                if ("0".equals(assessObj)) {
                    resultList = resistEarthquakesDEService.doZoning(calculationTasks);
                }
                //人员伤亡
                else if ("1".equals(assessObj)) {
                    resultList = casualtiesDEService1.doZoning(calculationTasks);
                }
                //经济损失
                else if ("2".equals(assessObj)) {
                    resultList = economicLossEDService.doZoning(calculationTasks);
                }
                for (FxqhAssessEdQhResult result : resultList) {
                    if (result.getEstimateObj() != null) {
                        int type = taskEstiConvertRiskZoneType(result);
                        result.setQhLevel(singleIndicatorRiskZoneSetService.getLevel(result.getCalculatedValue(), type));
                    }
                    enterAssessQhRepository.saveFxqhAssessEdResult(result);
                }
            }
            updateTask(calculationTasks);
            //更新计算进度
            for (String assessObj : assessObjArrStr.split(",")) {
                //破坏程度
                if ("0".equals(assessObj)) {
                    for (String seismicInputMode : calculationTasks.getSeismicInputMode().split(",")) {
                        if (seismicInputMode.equals("3")) {
                            calculationTasksRepository.updateFSProgress(calculationTasks.getId(), "单指标区划", "结构破坏");
                        }
                        if (seismicInputMode.equals("4")) {
                            calculationTasksRepository.updateCYProgress(calculationTasks.getId(), "单指标区划", "结构破坏");
                        }
                    }
                }
                //人员伤亡
                else if ("1".equals(assessObj)) {
                    for (String seismicInputMode : calculationTasks.getSeismicInputMode().split(",")) {
                        if (seismicInputMode.equals("3")) {
                            calculationTasksRepository.updateFSProgress(calculationTasks.getId(), "单指标区划", "人员伤亡");
                        }
                        if (seismicInputMode.equals("4")) {
                            calculationTasksRepository.updateCYProgress(calculationTasks.getId(), "单指标区划", "人员伤亡");
                        }
                    }
                }
                //经济损失
                else if ("2".equals(assessObj)) {
                    for (String seismicInputMode : calculationTasks.getSeismicInputMode().split(",")) {
                        if (seismicInputMode.equals("3")) {
                            calculationTasksRepository.updateFSProgress(calculationTasks.getId(), "单指标区划", "经济损失");
                        }
                        if (seismicInputMode.equals("4")) {
                            calculationTasksRepository.updateCYProgress(calculationTasks.getId(), "单指标区划", "经济损失");
                        }
                    }
                }
            }
            BizThreadPoolManage.exeBizThreadPoolExecutor.execute(() -> {
                //刷新指定超图工作空间数据源数据集
                boolean bool = hypergraphService.getWorkspaceReload("fxqh_assess_ed_qh_result");
            });
            restResponse = RestResponse.succeed();
            restResponse.setMessage("计算成功！");
        } catch (Exception e) {
            e.printStackTrace();
            restResponse = RestResponse.fail(e.getLocalizedMessage());
        }
        return restResponse;
    }

    public List<FxqhAssessEdQhResultVo> getAssessEdQhList(FxqhAssessEdQhResult param, Integer page, Integer rows) {
        List<FxqhAssessEdQhResult> assessEdQhList = enterAssessQhRepository.getAssessEdQhList(param, page, rows);
        return assessEdQhList.stream().map(o -> {
            FxqhAssessEdQhResultVo vo = new FxqhAssessEdQhResultVo();
            if (o.getCalculatedValue() == null) {
                o.setCalculatedValue(BigDecimal.ZERO);
            }
            BeanUtils.copyProperties(o, vo);
            if (o.getEstimateObj() != null) {
                // int type = taskEstiConvertRiskZoneType(o);
                // vo.setQhLevel(singleIndicatorRiskZoneSetService.getLevel(o.getCalculatedValue(), type));
                vo.setCondition(getConditionEn(o));
            }
            return vo;
        }).collect(Collectors.toList());
    }

    private static int taskEstiConvertRiskZoneType(FxqhAssessEdQhResult o) {
        int type;
        if (o.getEstimateObj().equals("0")) {
            type = 1;
        } else if (o.getEstimateObj().equals("1")) {
            type = 2;
            if (o.getBorderlandFlag() != null && o.getBorderlandFlag().equals("1")) {
                type = 3;
            }
        } else {
            type = 4;
            if (o.getBorderlandFlag() != null && o.getBorderlandFlag().equals("1")) {
                type = 5;
            }
        }
        return type;
    }

    private static String getConditionEn(FxqhAssessEdQhResult o) {
        String condition = o.getCondition();
        String conditionStr = o.getCondition();
        if (condition.equals("ld1")) {
            conditionStr = "VI";
        }
        if (condition.equals("ld2")) {
            conditionStr = "VII";
        }
        if (condition.equals("ld3")) {
            conditionStr = "VIII";
        }
        if (condition.equals("ld4")) {
            conditionStr = "IX";
        }
        if (condition.equals("ld5")) {
            conditionStr = "X";
        }
        if (condition.equals("sgglsz1")) {
            conditionStr = "50年内超越概率63%";
        }
        if (condition.equals("sgglsz2")) {
            conditionStr = "50年内超越概率10%";
        }
        if (condition.equals("sgglsz3")) {
            conditionStr = "50年内超越概率2%";
        }
        if (condition.equals("sgglsz4")) {
            conditionStr = "100年内超越概率1%";
        }
        return conditionStr;
    }

    public void exportData(HttpServletResponse response, QhSingleExportParam param) {
        List<QhSingleExportVO> qhSingleExportVOS = enterAssessQhRepository.getByParam(param);
        // //隐藏经纬度范围字段
        // ArrayList<String> list1 = new ArrayList<>();
        // list1.add("coordinateRange");
        // ExcelUtil.hideColumn(ExportVO.class, list1, true);
        ArrayList<String> list1 = new ArrayList<>();
        list1.add("years");
        ExcelUtil.hideColumn(QhSingleExportVO.class, list1, true);
        //条件(地震烈度 或 四个概率水准)
        if (param.getSeismicInputMode().equals("0")) {
            ExcelUtil.setExcelAnnotationValue(QhSingleExportVO.class, "condition",
                    "name", "烈度");
        }
        if (param.getSeismicInputMode().equals("1")) {
            ExcelUtil.setExcelAnnotationValue(QhSingleExportVO.class, "condition",
                    "name", "四个概率");
        }
        if (param.getSeismicInputMode().equals("2")) {
            //地震影响场没有条件字段
            ArrayList<String> list2 = new ArrayList<>();
            list2.add("condition");
            ExcelUtil.hideColumn(QhSingleExportVO.class, list2, true);
        }
        // String assessObj = param.getAssessObj();
        try {
            EasyPoiExcelUtil.exportExcel(qhSingleExportVOS, "单指标确定评估风险区划", "风险区划", QhSingleExportVO.class, "单指标确定评估风险区划.xlsx", response);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }


    public void downLoad(List<GdpVO> dbpList, HttpServletResponse response) {
        EasyPoiExcelUtil.exportExcel(dbpList, "上年度GDP 注:上年GDP不需要携带单位，只需要维护数值", "上年度GDP", GdpVO.class, "上年度GDP导入模板.xlsx", response);
    }

    @Transactional(rollbackFor = Exception.class)
    public String reportImport(InputStream inputStream, String taskId) throws Exception{
        enterAssessQhRepository.deleteGdpByTaskId(taskId);
        Workbook workbook  = WorkbookFactory.create(inputStream);
        List<GdpVO> list = getList(workbook, taskId);
        list.forEach(entity->enterAssessQhRepository.save(entity));
        return "上传成功";
    }

    private List<GdpVO> getList(Workbook workbook, String taskId) throws Exception{
        List<GdpVO> voList = new ArrayList<>();
        if (workbook != null) {
            //循环除了第一行的所有行
            /** 得到第一个sheet */
            Sheet sheet = workbook.getSheetAt(0);
            /** 得到Excel的行数 */
            int totalRows = sheet.getPhysicalNumberOfRows();
            HSSFDataFormatter hSSFDataFormatter = new HSSFDataFormatter();
            /** 循环Excel的行 从第3行开始*/
            for (int r = 2; r < totalRows; r++) {
                Row row = sheet.getRow(r);
                if (row == null) {
                    continue;
                }
                GdpVO obj = new GdpVO();
                obj.setId(UUIDGenerator.getUUID());
                //省
                String province = hSSFDataFormatter.formatCellValue(row.getCell(0));
                if(org.apache.commons.lang3.StringUtils.isBlank(province)){
                    throw new RuntimeException("请维护第"+(r+1)+"行的省信息");
                }
                obj.setProvinceName(province);
                //市
                String city = hSSFDataFormatter.formatCellValue(row.getCell(1));
                if(org.apache.commons.lang3.StringUtils.isBlank(city)){
                    throw new RuntimeException("请维护第"+(r+1)+"行的市信息");
                }
                obj.setCityName(city);
                //县
                String county = hSSFDataFormatter.formatCellValue(row.getCell(2));
                if(org.apache.commons.lang3.StringUtils.isBlank(county)){
                    throw new RuntimeException("请维护第"+(r+1)+"行的区县信息");
                }
                obj.setCountyName(county);
                //GDP
                String gdp = hSSFDataFormatter.formatCellValue(row.getCell(3));
                if(PlatformObjectUtils.isEmpty(gdp)){
                    throw new RuntimeException("请维护第"+(r+1)+"行的GDP信息");
                }
                if(new BigDecimal(gdp).compareTo(BigDecimal.ZERO) == 0){
                    throw new RuntimeException("第"+(r+1)+"行的GDP对应值必须大于0");
                }
                gdp = gdp.replace("万元","").replace("万","").replace("元","");
                obj.setPreviousGdp(new BigDecimal(gdp));
                obj.setTaskId(taskId);
                obj.setCreateUser(PlatformObjectUtils.isEmpty(PlatformSessionContext.getUserID())?"":PlatformSessionContext.getUserID());
                obj.setCreateTime(new Date());
                voList.add(obj);
            }
        }
        if(voList.size()==0){
            throw new RuntimeException("上传完成，没有获取到GDP数据，上传成功0条数据");
        }
        return voList;
    }

    public void downLoadData(String taskId, HttpServletResponse response) {
        List<GdpVO> dbpList = enterAssessQhRepository.getGdpByTaskId(taskId);
        EasyPoiExcelUtil.exportExcel(dbpList, "上年度GDP 注:上年GDP不需要携带单位，只需要维护数值", "上年度GDP", GdpVO.class, "上年度GDP导入模板.xlsx", response);
    }
}
